<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<%@ include file="/WEB-INF/views/include/header.jsp"%>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-cmsCategory-add">
		<input id="treeId" name="parentId" type="hidden" value="${category.catId}"   />
		<%--<div class="form-group">--%>
			<%--<label class="col-sm-2 control-label required_hold">站点编号：</label>--%>
			<%--<div class="col-sm-10">--%>
				<%--<input id="siteId" name="siteId" class="form-control" type="text">--%>
			<%--</div>--%>
		<%--</div>--%>
		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">所属栏目：</label>
			<div class="col-sm-10">
				<%--<input id="parentId" name="parentId" class="form-control" type="text">--%>
				<input class="form-control" type="text" name="parentName" onclick="selectCateTree()" readonly="true" id="treeName">
			</div>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label required_hold"><em class="required_red">*</em>栏目名称：</label>
			<div class="col-sm-4">
				<input id="catName" name="catName" class="form-control" type="text">
			</div>

			<label class="col-sm-2 control-label required_hold">栏目编码：</label>
			<div class="col-sm-4">
				<input id="catCode" name="catCode" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">栏目英文 </label>
			<div class="col-sm-4">
				<input id="catEnglish" name="catEnglish" class="form-control" type="text">
			</div>

			<label class="col-sm-2 control-label required_hold">链接 </label>
			<div class="col-sm-4">
				<input id="catUrl" name="catUrl" class="form-control" type="text">
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">页面标题：</label>
			<div class="col-sm-10">
				<input id="title" name="title" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">关键词：</label>
			<div class="col-sm-10">
				<input id="keywords" name="keywords" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">描述文字：</label>
			<div class="col-sm-10">
				<%--<input id="description" name="description" class="form-control" type="text">--%>
				<textarea id="description" name="description" rows="5" maxlength="450" class="form-control"></textarea>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">栏目模型：</label>
			<div class="col-sm-4">
				<input id="catModelid" name="catModelid" class="form-control" type="text">
			</div>

			<label class="col-sm-2 control-label required_hold">文档模型：</label>
			<div class="col-sm-4">
				<input id="newsModelid" name="newsModelid" class="form-control" type="text">
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">栏目模板：</label>
			<div class="col-sm-4">
				<input id="catTemplate" name="catTemplate" class="form-control" type="text">
			</div>

			<label class="col-sm-2 control-label required_hold">文档模板：</label>
			<div class="col-sm-4">
				<input id="newsTemplate" name="newsTemplate" class="form-control" type="text">
			</div>

		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">是否生成栏目页 </label>
			<div class="col-sm-4">
				<select id="isGenerateNode" name="isGenerateNode" class="form-control m-b"  >
					<c:forEach items="${fnc:getDictDataByTypeList('sys_user_sex')}" var="dict">
						<option  value="${dict.dictValue}" >${dict.dictLabel}</option>
					</c:forEach>
				</select>
			</div>

			<label class="col-sm-2 control-label required_hold">是否生成文档页：</label>
			<div class="col-sm-4">
				<select id="isGenerateNews" name="isGenerateNews" class="form-control m-b"  >
					<c:forEach items="${fnc:getDictDataByTypeList('sys_user_sex')}" var="dict">
						<option  value="${dict.dictValue}" >${dict.dictLabel}</option>
					</c:forEach>
				</select>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">栏目页扩展名：</label>
			<div class="col-sm-4">
				<select id="catExt" name="catExt" class="form-control m-b"  >
					<c:forEach items="${fnc:getDictDataByTypeList('sys_user_sex')}" var="dict">
						<option  value="${dict.dictValue}" >${dict.dictLabel}</option>
					</c:forEach>
				</select>
			</div>

			<label class="col-sm-2 control-label required_hold">文档页扩展名：</label>
			<div class="col-sm-4">
				<select id="newsExt" name="newsExt" class="form-control m-b"  >
					<c:forEach items="${fnc:getDictDataByTypeList('sys_user_sex')}" var="dict">
						<option  value="${dict.dictValue}" >${dict.dictLabel}</option>
					</c:forEach>
				</select>

			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">栏目路径：</label>
			<div class="col-sm-4">
				<input id="catPath" name="catPath" class="form-control" type="text">
			</div>
			<label class="col-sm-2 control-label required_hold">文档路径：</label>
			<div class="col-sm-4">
				<input id="newsPath" name="newsPath" class="form-control" type="text">
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">是否默认页：</label>
			<div class="col-sm-10">
				<input id="isDefPage" name="isDefPage" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">静态页生成方式(0:手动生成;1:自动生成栏目页;2:自动生成文档页及栏目页;3:自动生成文档页、栏目页、父栏目页、首页)：</label>
			<div class="col-sm-4">
				<input id="staticMethod" name="staticMethod" class="form-control" type="text">
			</div>
			<label class="col-sm-2 control-label required_hold">栏目列表静态化页数：</label>
			<div class="col-sm-4">
				<input id="staticPage" name="staticPage" class="form-control" type="text">
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">栏目图：</label>
			<div class="col-sm-10">
				<input id="image" name="image" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">小图：</label>
			<div class="col-sm-10">
				<input id="smallImage" name="smallImage" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">大图：</label>
			<div class="col-sm-10">
				<input id="largeImage" name="largeImage" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<%--0、待审核  1、通过 2、未通过：--%>
			<label class="col-sm-2 control-label required_hold">审核状态</label>
			<div class="col-sm-10">
				<input id="checkStatus" name="checkStatus" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<%--0、删除 1、正常 2、禁止：--%>
			<label class="col-sm-2 control-label required_hold">状态:</label>
			<div class="col-sm-10">
				<input id="status" name="status" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">是否显示0、不显1、显示：</label>
			<div class="col-sm-10">
				<input id="isShow" name="isShow" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">排序：</label>
			<div class="col-sm-10">
				<input id="sort" name="sort" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label required_hold">备注：</label>
			<div class="col-sm-10">
				<input id="remark" name="remark" class="form-control" type="text">
			</div>
		</div>
	</form>
</div>
<%@ include file="/WEB-INF/views/include/footer.jsp"%>
<script type="text/javascript">
    var prefix = ctx + "cms/category"
    $("#form-cmsCategory-add").validate({
        rules:{
            xxxx:{
                required:true,
            },
        }
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-cmsCategory-add').serialize());
        }
    }

    /*用户管理-新增-选择栏目树*/
    function selectCateTree() {
        var treeId = $("#treeId").val();
        var catId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
        var url = ctx + "cms/category/selectCateTree/" + catId;
        var options = {
            title: '选择栏目',
            width: "380",
            url: ctx + "cms/category/selectCateTree/" + catId,
            callBack: doSubmit
        };
        $.modal.openOptions(options);
    }

    function doSubmit(index, layero){
        var tree = layero.find("iframe")[0].contentWindow.$._tree;
        if ($.tree.notAllowParents(tree)) {
            var body = layer.getChildFrame('body', index);
            $("#treeId").val(body.find('#treeId').val());
            $("#treeName").val(body.find('#treeName').val());
            layer.close(index);
        }
    }

</script>
</body>
</html>
